
<?php
$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
$this->headTitle()->setSeparator(' - ');
$this->headTitle('The Job Portal');
error_reporting(E_ALL);
echo $this->doctype();


$basepath = Zend_Controller_Front::getInstance()->getBaseUrl();

function getLinks($controller, $action, $label) {
    $link = gethref($controller, $action);
    $format = "<a href='$link'>$label</a>";
    return $format;
}

function gethref($controller, $action) {
    $link = Zend_Controller_Front::getInstance()->getBaseUrl() . '/' .
            $controller . '/' . $action;
    return $link;
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <SCRIPT LANGUAGE="JavaScript" SRC="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript" SRC="http://jqueryui.com/ui/jquery.ui.core.js"></SCRIPT>
        <SCRIPT LANGUAGE="JavaScript" SRC="http://jqueryui.com/ui/jquery.ui.datepicker.js"></SCRIPT>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
        <?php echo $this->headLink()->prependStylesheet($this->baseUrl() . '/css/jopPortalLook.css'); ?>

        <?php
        $actionhelper = Zend_Controller_Action_HelperBroker::getExistingHelper('CustomActionHelper');
        $role = $actionhelper->getRole();
        if ($role == APP_Authorization_Roles::GUEST) {
            echo "<style type ='text/css'>
    .maincontent{ float: left;
    padding-left: 0px;
    width: 859px;
    margin-left: 186px;
;}
    </style>";
        }
        ?>
    </head>
    <body>
        <div id="body">
            <div id="status" class ="status">
<?php
        $basepath = $this->baseUrl();
        if (Zend_Auth::getInstance()->hasIdentity()) {
            $val = Zend_Auth::getInstance()->getStorage()->read()->Username;
            echo "Welcome $val";
        }
?>
            </div>

            <div id="navigation" class="topnav">
                <a class ="logo"
                   href="<?php echo Zend_Controller_Front::getInstance()->getBaseUrl() ?>" >
                    <img src="<?php echo $basepath ?>/images/logo.jpg" />
                </a>
                <div class="slogan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    &nbsp;&nbsp;&nbsp;&nbsp;Employer & Employee</div>
<?php echo $this->navigation()->menu(); ?>

            </div>
            <div class="maincontent2"> <img src="<?php echo $basepath ?>/images/top.gif"/> </div>
            <?php 
                if($role == APP_Authorization_Roles::EMPLOYEE)
            echo "<div class='maincontent2'>
                <img src='$basepath/images/background_employee.jpg'/> </div>
            </div>";
                else if($role == APP_Authorization_Roles::EMPLOYER)
                    echo "<div class='maincontent2'>
                <img src='$basepath/images/background_employer.jpg'/> </div>
            </div>";
                 else if($role == APP_Authorization_Roles::GUEST)
            echo "<div class='maincontent2'>
                <img src='$basepath/images/background_main.jpg'/> </div>
            </div>";
        ?>
            <div id="content" class ="content">
                <?php
                if($role == APP_Authorization_Roles::EMPLOYEE)
                echo "<div id='myjobportal' class='myjobportal'>My Job Portal</div>";
                    else if($role == APP_Authorization_Roles::EMPLOYER)
                        echo "<div id='myjobportal' class='myjobportal'>My Job Portal</div>";
                ?>
                <div id ="leftsidebar" class ="leftsidebar">
<?php
                if (Zend_Auth::getInstance()->hasIdentity()) {
                    echo $this->partial('loginLink.phtml');
                }
?>
                </div>

                <div id="maincontent" class ="maincontent">
                    <?php echo $this->layout()->content; ?>
                </div>

                <div id="rightsidebar" class ="rightsidebar">
                    <p>  </p>
                </div>
            </div>

            <div id="footer" class="maincontent3"><img src="<?php echo $basepath ?>/images/footer_bg.gif"/>
                <div class="lastline">
                    <p>The Job Portal © 2011. All rights reserved on Group 4.| <span class="feedback"><?php echo getLinks("index","feedback","Feedback");?></span></p>
                </div>
            </div>
        </div>
    </body>
</html>